package com.huaifang.yan.controller;

import com.huaifang.yan.facade.Consumer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author yanhuaifang
 */
@RequestMapping("consumer")
@RestController
public class ConsumerController {

    @Value("${spring.profiles.active}")
    private String active;
    @Resource
    private Consumer consumer;

    @RequestMapping(path = "notice", method = RequestMethod.GET)
    public String notice() throws InterruptedException {
        return consumer.hello(active);
    }
}
